/* 智能通风系统页面样式 - 简洁优雅风格 */
:root {
    /* 主要颜色 - 简洁蓝色主题 */
    --primary-color: #0A3A8F;
    --primary-light: #1976D2;
    --primary-dark: #0E1D47;
    --accent-color: #42A5F5;
    
    /* 背景色和渐变 */
    --background-gradient-start: #0A3A8F;
    --background-gradient-end: #0E1D47;
    
    /* 文本颜色 - 统一为白色 */
    --text-primary: #FFFFFF;
    --text-secondary: #FFFFFF;
    --text-muted: #FFFFFF;
    
    /* 状态颜色 */
    --status-normal: #4CAF50;
    --status-off: #F44336;
    --status-warning: #FF9800;
    
    /* 卡片样式 - 简洁设计 */
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-border: rgba(255, 255, 255, 0.12);
    --card-hover: rgba(255, 255, 255, 0.12);
    
    /* 布局尺寸 */
    --header-height: 64px;
    --sidebar-width: 200px;
    --card-spacing: 20px;
    --border-radius: 16px;
}

/* 基础样式重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    color: #FFFFFF; /* 全局白色文字 */
}

html, body {
    height: 100%;
    font-family: 'Roboto', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--background-gradient-start) 0%, var(--background-gradient-end) 100%);
    color: #FFFFFF;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
}

/* 主内容区域 */
.app-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 20px;
    gap: 20px;
}

/* 侧边栏样式 - 简化设计 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--card-bg);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    overflow: hidden;
}

.tab-header {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 8px;
}

.tab {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 12px;
    margin-bottom: 4px;
    color: #FFFFFF;
}

.tab:hover {
    background: var(--card-hover);
    color: #FFFFFF;
}

.tab.active {
    background: rgba(25, 118, 210, 0.2);
    color: #FFFFFF;
    font-weight: 500;
}

.tab i {
    font-size: 16px;
    margin-right: 12px;
    color: #FFFFFF;
}

.tab span {
    font-size: 14px;
    color: #FFFFFF;
}

/* 内容区域样式 */
.content-area {
    flex: 1;
    overflow-y: auto;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    padding: 24px;
}

.tab-content {
    display: none;
    height: 100%;
}

.tab-content:first-child {
    display: block;
}

/* 控制面板样式 */
.control-panel {
    background-color: transparent;
    padding: 0;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 20px;
    color: #FFFFFF;
    text-align: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
}

/* 全局操作按钮 - 简化设计 */
.global-actions {
    display: flex;
    justify-content: right;
    margin-bottom: 20px; /* 减少底部边距 */
    gap: 16px;
    flex-wrap: wrap;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center; /* 确保内容居中 */
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 100px;
    text-align: center; /* 文字居中 */
    color: #FFFFFF; /* 确保按钮文字为白色 */
}

/* 开启按钮 */
.btn-action.layui-btn-normal,
.global-actions .layui-btn-normal {
    background: rgba(76, 175, 80, 0.8);
    color: #FFFFFF;
    border: 1px solid rgba(76, 175, 80, 0.9);
}

.btn-action.layui-btn-normal:hover,
.global-actions .layui-btn-normal:hover {
    background: rgba(76, 175, 80, 1);
    transform: translateY(-1px);
    color: #FFFFFF;
}

/* 关闭按钮 */
.btn-action.layui-btn-danger,
.global-actions .layui-btn-danger {
    background: rgba(244, 67, 54, 0.8);
    color: #FFFFFF;
    border: 1px solid rgba(244, 67, 54, 0.9);
}

.btn-action.layui-btn-danger:hover,
.global-actions .layui-btn-danger:hover {
    background: rgba(244, 67, 54, 1);
    transform: translateY(-1px);
    color: #FFFFFF;
}

/* 设置按钮的特定样式 */
.btn-goto-settings.layui-btn-primary {
    background: rgba(25, 118, 210, 0.8); /* 使用蓝色调 */
    color: #FFFFFF;
    border: 1px solid rgba(25, 118, 210, 0.9);
}

.btn-goto-settings.layui-btn-primary:hover {
    background: rgba(25, 118, 210, 1); /* 悬停时加深颜色 */
    transform: translateY(-1px);
    color: #FFFFFF;
}

.btn-action i {
    margin-right: 8px;
    font-size: 16px;
    color: #FFFFFF;
}

/* 设备卡片容器 */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px; /* 减小卡片间距 */
    padding: 4px;
}

/* 设备卡片样式 - 更紧凑设计 */
.device-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    padding: 10px; /* 减少内边距 */
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    position: relative;
    min-width: 220px;
    max-width: 320px;
    min-height: 180px; /* 增加最小高度，确保按钮可见 */
}

.device-card:hover {
    background: var(--card-hover);
    transform: translateY(-2px);
}

/* 设备信息区域 */
.device-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 设备标题和状态 - 顶部布局 */
.device-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px; /* 减少底部边距 */
}

.device-info h3,
.device-header h3 {
    font-size: 1rem; /* 减小字体大小 */
    font-weight: 500;
    color: #FFFFFF;
    margin: 0;
}

.device-status {
    font-size: 0.9rem;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 设备参数显示区域 */
.device-params {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px; /* 减少间距 */
    margin-bottom: 6px; /* 减少底部边距 */
}

.param-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0; /* 减少内边距 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.param-item:last-child {
    border-bottom: none;
}

.param-label {
    font-size: 0.8rem; /* 减小字体大小 */
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    gap: 1px; /* 减少间距 */
}

.param-name {
    font-weight: 500;
    color: #FFFFFF;
}

.param-unit {
    font-size: 0.7rem; /* 减小字体大小 */
    color: #FFFFFF;
}

.param-value {
    font-size: 1.5rem; /* 减小字体大小 */
    font-weight: 300;
    color: #FFFFFF;
    text-align: right;
    line-height: 1;
}

.param-value .unit {
    font-size: 0.8rem; /* 减小字体大小 */
    color: #FFFFFF;
    margin-left: 4px;
}

/* 状态指示器 */
.status-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 6px; /* 减少内边距 */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.status-label {
    font-size: 0.8rem; /* 减小字体大小 */
    color: #FFFFFF;
}

.status-value, .fan-status {
    font-size: 0.8rem; /* 减小字体大小 */
    font-weight: 500;
    padding: 2px 8px; /* 减少内边距 */
    border-radius: 12px;
    text-transform: none;
}

.status-on, .status-value.status-on, .fan-status.status-on {
    background: rgba(76, 175, 80, 0.8);
    color: #FFFFFF;
    border: 1px solid rgba(76, 175, 80, 0.9);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.status-off, .status-value.status-off, .fan-status.status-off {
    background: rgba(244, 67, 54, 0.8);
    color: #FFFFFF;
    border: 1px solid rgba(244, 67, 54, 0.9);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 添加更多状态样式 */
.status-warning, .status-value.status-warning, .fan-status.status-warning {
    background: rgba(255, 152, 0, 0.8);
    color: #FFFFFF;
    border: 1px solid rgba(255, 152, 0, 0.9);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.status-pause, .status-value.status-pause, .fan-status.status-pause {
    background: rgba(255, 193, 7, 0.8);
    color: #FFFFFF;
    border: 1px solid rgba(255, 193, 7, 0.9);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.status-unknown, .status-value.status-unknown, .fan-status.status-unknown {
    background: rgba(158, 158, 158, 0.8);
    color: #FFFFFF;
    border: 1px solid rgba(158, 158, 158, 0.9);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 设备操作按钮 - 紧凑设计 */
.device-actions {
    display: flex;
    gap: 6px; /* 减少间距 */
    justify-content: space-between;
    margin-top: 10px; /* 增加顶部边距 */
}

.device-actions button,
.device-actions button.layui-btn-normal,
.device-actions button.layui-btn-danger {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    font-size: 13px; /* 减小字体大小 */
    font-weight: 500;
    padding: 8px 12px; /* 减少内边距 */
    flex: 1;
    box-shadow: none;
    transition: background 0.2s, color 0.2s;
    height: 36px; /* 增加高度，确保按钮不会太小 */
    min-height: 36px; /* 设置最小高度 */
}

.device-actions button:hover,
.device-actions button:focus,
.device-actions button.layui-btn-normal:hover,
.device-actions button.layui-btn-danger:hover {
    background: rgba(255,255,255,0.3);
    color: #fff;
}
.device-actions button:disabled,
.device-actions button.layui-btn-normal:disabled,
.device-actions button.layui-btn-danger:disabled {
    background: rgba(255,255,255,0.2);
    color: #fff;
    opacity: 0.8;
    cursor: not-allowed;
}

/* 自动按钮样式 */
.device-actions button.btn-auto {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}

.device-actions button.btn-auto:hover {
    background: rgba(255,255,255,0.3);
    color: #fff;
}

/* 自动按钮激活状态 */
.device-actions button.btn-auto.active {
    background: rgba(33, 150, 243, 0.8);
    color: #fff;
    border: 1px solid rgba(33, 150, 243, 0.9);
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.device-actions button i {
    margin-right: 8px;
    font-size: 16px;
    color: #FFFFFF;
}

/* 加载和空数据状态 */
.empty-data {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    padding: 40px;
    text-align: center;
}

.empty-data i {
    font-size: 48px;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.empty-data p {
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 400;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .app-content {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
    }
    
    .tab-header {
        flex-direction: row;
        overflow-x: auto;
        padding: 8px;
    }
    
    .tab {
        flex-shrink: 0;
        margin-right: 8px;
        margin-bottom: 0;
    }
    
    .tab span {
        display: none;
    }
    
    .tab i {
        margin-right: 0;
        font-size: 18px;
    }
    
    .cards-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .global-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-action {
        width: 100%;
    }
}